package com.yqg.protection.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yqg.protection.entity.InspectAddrCode;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zxf
 * @since 2024-11-18
 */
@Mapper
public interface InspectAddrCodeMapper extends BaseMapper<InspectAddrCode> {

    Long findPageCount(String keyWord, Integer level, Long organizationId, String isAllClient, List<Long> clientIds);

    List<InspectAddrCode> findPage(Integer pageNum, Integer pageSize, String keyWord, Integer level, Long organizationId, String isAllClient, List<Long> clientIds);

    List<InspectAddrCode> findAll(Integer level, Long organizationId, String isAllClient, List<Long> clientIds);

    InspectAddrCode selectRecordCount(Long id);

    @Select("select *,client.name as clientName from inspect_addr_code left join client on inspect_addr_code.client_id = client.id where inspect_addr_code.id = #{id}")
    InspectAddrCode getDataById(Long id);
}
